home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / menu / biosio.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-14  |  2.3 KB  |  89 lines

  1. /* -*- c -*- ------------------------------------------------------------- *
  2.  *   
  3.  *   Copyright 2004 Murali Krishnan Ganapathy - All Rights Reserved
  4.  *
  5.  *   This program is free software; you can redistribute it and/or modify
  6.  *   it under the terms of the GNU General Public License as published by
  7.  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
  8.  *   Boston MA 02111-1307, USA; either version 2 of the License, or
  9.  *   (at your option) any later version; incorporated herein by reference.
  10.  *
  11.  * ----------------------------------------------------------------------- */
  12.  
  13. #ifndef __BIOSIO_H__
  14. #define __BIOSIO_H__
  15.  
  16. #ifndef NULL
  17. #define NULL ((void *)0)
  18. #endif
  19.  
  20. #define BELL 0x07
  21. // CHRELATTR = ^N, CHABSATTR = ^O
  22. #define CHABSATTR 15 
  23. #define CHRELATTR 14
  24.  
  25. /* BIOS Assisted output routines */
  26.  
  27. void csprint(const char *str, char attr); // Print a C str (NUL-terminated)
  28.  
  29. void cprint(char chr,char attr,int times,char disppage); // Print a char 
  30.  
  31. void setdisppage(char num); // Set the display page to specified number
  32.  
  33. char getdisppage(); // Get current display page 
  34.  
  35. void clearwindow(char top, char left, char bot, char right, 
  36.          char page, char fillchar, char fillattr);
  37.  
  38. void cls(void);            /* Clears the entire current screen page */
  39.  
  40. void gotoxy(char row,char col, char page);
  41.  
  42. void getpos(char * row, char * col, char page);
  43.  
  44. char inputc(char * scancode); // Return ASCII char by val, and scancode by reference
  45.  
  46.  
  47. void putch(char x, char attr, char page); // Print one char
  48.  
  49. void cursoroff(void);        /* Turns on cursor */
  50.  
  51. void cursoron(void);        /* Turns off cursor */
  52.  
  53. void getstring(char *str, unsigned int size);
  54.  
  55. static inline unsigned char readbiosb(unsigned short addr)
  56. {
  57.     unsigned char v;
  58.  
  59.     asm("movw %2,%%fs ; "
  60.     "movb %%fs:%1,%0"
  61.     : "=abcd" (v)
  62.     : "m" (*(unsigned char *)(unsigned int)addr),
  63.     "r" ((unsigned short)0));
  64.     return v;
  65. }
  66. static inline char getnumrows()
  67. {
  68.     return readbiosb(0x484);
  69. }
  70.  
  71. static inline char getnumcols(void)
  72. {
  73.     return readbiosb(0x44a);
  74. }
  75.  
  76. void scrollup(); //Scroll up display screen by one line
  77.  
  78. void setvideomode(char mode); // Set the video mode.
  79.  
  80. unsigned char sleep(unsigned int msec); // Sleep for specified time
  81.  
  82. void beep(); // A Bell
  83.  
  84. unsigned char checkkbdbuf(); // Check to see if there is kbd buffer is non-empty?
  85.  
  86. void clearkbdbuf(); // Clear the kbd buffer (how many chars removed?)
  87.  
  88. #endif
  89.